package com.jkd.domain;

import com.ejlchina.searcher.bean.DbField;
import com.ejlchina.searcher.bean.SearchBean;
import lombok.Data;

import java.util.Date;

/**
 * 测点对象 t_measuring_point
 *
 * @author ruoyi
 * @date 2022-10-09
 */
@Data
@SearchBean(tables = "t_measuring_point tmp " +
        "left join t_alarm_strategy tas on tas.id = tmp.alarm_strategy_id", autoMapTo = "tmp")
public class MeasuringPoint {

    /**
     * id
     */
    @DbField("tmp.id")
    private String id;

    /**
     * dtu编号
     */
    @DbField("tmp.dtu_coding")
    private String dtuCoding;

    /**
     * 采集模块编号
     */
    @DbField("tmp.acquisition_module_coding")
    private String acquisitionModuleCoding;

    /**
     * 传感器编号
     */
    @DbField("tmp.sensor_coding")
    private String sensorCoding;

    /**
     * 项目
     */
    @DbField("tmp.project_id")
    private Integer projectId;

    /**
     * 采集策略
     */
    @DbField("tmp.acquisition_strategy_id")
    private Integer acquisitionStrategyId;

    /**
     * 报警策略
     */
    @DbField("tmp.alarm_strategy_id")
    private Integer alarmStrategyId;

    /**
     * 测点名称
     */
    @DbField("tmp.point_name")
    private String pointName;

    /**
     * 测点指令
     */
    @DbField("tmp.instructions")
    private String instructions;

    /**
     * 状态（0启用1停用）
     */
    @DbField("tmp.status")
    private String status;

    @DbField("tmp.create_time")
    private Date createTime;
    @DbField("tmp.create_by")
    private String createBy;
    @DbField("tmp.update_time")
    private Date updateTime;
    @DbField("tmp.update_by")
    private String updateBy;
    @DbField("tmp.tenant_id")
    private Integer tenantId;

    //--------------------以下为关联表(报警策略)----------------------
    /**
     * 报警类型 1阈值报警 2空值报警 3超量程报警
     */
    @DbField("tas.alarm_type")
    private String alarmType;

    /**
     * 1级预警
     */
    @DbField("tas.level1_warning")
    private String level1Warning;

    /**
     * 2级预警
     */
    @DbField("tas.level2_warning")
    private String level2Warning;

    /**
     * 最大量程
     */
    @DbField("tas.maximum_range")
    private String maximumRange;

    /**
     * 报警值
     */
    @DbField("tas.alarm_value")
    private String alarmValue;

    //--------------------以下为关联表(传感器表)----------------------
    /**
     * 安装位置
     */
//    @DbField("ts.install_position")
//    private String installPosition;
}
